<?php
/**
 * 公共函数文件
 * @author hary
 * @version 1.0
 */

function errorReport($level,$message,$file,$line)
{
	$tpl_name = "error_report";

	Log::write("Error: [$level] $message");

	$msg = "抱歉，出错了啊！";
	//echo "Error: [$level] $message  $file   $line";
//	$this->tpl->assign('Error',$msg);
//
//	$this->tpl->display($tpl_name);
}
set_error_handler('errorReport');



//function myErrorHandler($errno, $errstr, $errfile, $errline)
//{
//    $errfile = str_replace(getcwd(),"",$errfile);
//    $errstr  = str_replace(getcwd(),"",$errstr);
// 	
//    echo "<b>My NOTICE</b> [$errno] $errstr<br />\n";
//    switch ($errno) {
//    case E_USER_ERROR:
// 
//     echo "<b>My ERROR</b> [$errno] $errstr<br />\n";
//        echo "  Fatal error on line $errline in file $errfile";
//        echo ", PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n";
//        echo "Aborting...<br />\n";
//        exit(1);
//        break;
// 
//    case E_USER_WARNING:
//        echo "<b>My WARNING</b> [$errno] $errstr<br />\n";
//        break;
// 
//    case E_USER_NOTICE:
//        echo "<b>My NOTICE</b> [$errno] $errstr<br />\n";
//        break;
// 
//    default:
//        break;
//    }
 
//}
 
//set_error_handler('myErrorHandler');

?>